-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add target CoreWingF405WingV2 #11290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Branch Targeting SuggestionYou've targeted the
If This is an automated suggestion to help route contributions to the appropriate branch. |
ⓘ Your approaching your monthly quota for Qodo. Upgrade your plan PR Compliance Guide 🔍All compliance sections have been disabled in the configurations. |
| #define USE_UART2 | ||
| #define UART2_TX_PIN PA2 | ||
| #define UART2_RX_PIN PA3 | ||
|
|
||
| #define USE_UART3 | ||
| #define UART3_TX_PIN PC10 | ||
| #define UART3_RX_PIN PC11 | ||
|
|
||
| #define USE_UART4 | ||
| #define UART4_TX_PIN PA0 | ||
| #define UART4_RX_PIN PA1 | ||
|
|
||
| #define USE_UART5 | ||
| #define UART5_TX_PIN PC12 | ||
| #define UART5_RX_PIN PD2 | ||
|
|
||
| #define USE_UART6 | ||
| #define UART6_TX_PIN PC6 | ||
| #define UART6_RX_PIN PC7 | ||
|
|
||
| //Optional Softserial on UART2 TX Pin PA2 | ||
| #define USE_SOFTSERIAL1 | ||
| #define SOFTSERIAL_1_TX_PIN PA2 | ||
| #define SOFTSERIAL_1_RX_PIN PA2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Change SOFTSERIAL_1_RX_PIN from PA2 to PA3 to resolve the pin conflict with SOFTSERIAL_1_TX_PIN and align it with the UART2_RX_PIN. [possible issue, importance: 8]
| #define USE_UART2 | |
| #define UART2_TX_PIN PA2 | |
| #define UART2_RX_PIN PA3 | |
| #define USE_UART3 | |
| #define UART3_TX_PIN PC10 | |
| #define UART3_RX_PIN PC11 | |
| #define USE_UART4 | |
| #define UART4_TX_PIN PA0 | |
| #define UART4_RX_PIN PA1 | |
| #define USE_UART5 | |
| #define UART5_TX_PIN PC12 | |
| #define UART5_RX_PIN PD2 | |
| #define USE_UART6 | |
| #define UART6_TX_PIN PC6 | |
| #define UART6_RX_PIN PC7 | |
| //Optional Softserial on UART2 TX Pin PA2 | |
| #define USE_SOFTSERIAL1 | |
| #define SOFTSERIAL_1_TX_PIN PA2 | |
| #define SOFTSERIAL_1_RX_PIN PA2 | |
| #define USE_UART2 | |
| #define UART2_TX_PIN PA2 | |
| #define UART2_RX_PIN PA3 | |
| ... | |
| //Optional Softserial on UART2 TX Pin PA2 | |
| #define USE_SOFTSERIAL1 | |
| #define SOFTSERIAL_1_TX_PIN PA2 | |
| #define SOFTSERIAL_1_RX_PIN PA3 |
| serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART6)].functionMask = FUNCTION_RX_SERIAL; | ||
| serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART5)].functionMask = FUNCTION_GPS; | ||
| serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART1)].functionMask = FUNCTION_MSP; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Add checks to verify that the index returned by findSerialPortIndexByIdentifier is not -1 before using it to access the portConfigs array, preventing potential out-of-bounds access. [possible issue, importance: 6]
| serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART6)].functionMask = FUNCTION_RX_SERIAL; | |
| serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART5)].functionMask = FUNCTION_GPS; | |
| serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART1)].functionMask = FUNCTION_MSP; | |
| int idx; | |
| idx = findSerialPortIndexByIdentifier(SERIAL_PORT_USART6); | |
| if (idx >= 0) serialConfigMutable()->portConfigs[idx].functionMask = FUNCTION_RX_SERIAL; | |
| idx = findSerialPortIndexByIdentifier(SERIAL_PORT_USART5); | |
| if (idx >= 0) serialConfigMutable()->portConfigs[idx].functionMask = FUNCTION_GPS; | |
| idx = findSerialPortIndexByIdentifier(SERIAL_PORT_USART1); | |
| if (idx >= 0) serialConfigMutable()->portConfigs[idx].functionMask = FUNCTION_MSP; |
| #include "drivers/pinio.h" | ||
| #include "drivers/sensor.h" | ||
|
|
||
| BUSDEV_REGISTER_SPI_TAG(busdev_icm42688, DEVHW_ICM42605, ICM42605_SPI_BUS, ICM42605_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_ICM42605_ALIGN); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Change the hardware identifier from DEVHW_ICM42605 to DEVHW_ICM42688 in the BUSDEV_REGISTER_SPI_TAG macro to match the actual ICM42688P sensor on the board. [general, importance: 7]
| BUSDEV_REGISTER_SPI_TAG(busdev_icm42688, DEVHW_ICM42605, ICM42605_SPI_BUS, ICM42605_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_ICM42605_ALIGN); | |
| BUSDEV_REGISTER_SPI_TAG(busdev_icm42688, DEVHW_ICM42688, ICM42605_SPI_BUS, ICM42605_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_ICM42605_ALIGN); |
User description
Summary
Adds support for the CoreWing F405 Wing V2 flight controller board.
Hardware Specifications
Default Port Configuration
Pin Mapping
Motor/Servo Outputs
SPI Bus Assignment
I2C Bus Assignment
UART Pin Mapping
Notes
PR Type
Enhancement
Description
Block Diagram
PR Type
Enhancement
Description
Adds support for CoreWing F405 Wing V2 flight controller board
Configures ICM42688P gyro with CW270 alignment on SPI1
Enables 11 motor/servo outputs with full DMA/DSHOT support
Includes 6 UARTs, OSD, SD card blackbox, barometer, magnetometer
Supports rangefinder, pitot tube, LED strip, and PINIO features
Diagram Walkthrough
File Walkthrough
target.h
Complete hardware configuration and pin definitionssrc/main/target/COREWINGF405WINGV2/target.h
CW4W2and product namecard
sensors
monitoring
target.c
Timer and sensor hardware initializationsrc/main/target/COREWINGF405WINGV2/target.c
assignments
config.c
Default serial port and PINIO configurationsrc/main/target/COREWINGF405WINGV2/config.c
CMakeLists.txt
Build system configurationsrc/main/target/COREWINGF405WINGV2/CMakeLists.txt